package com.caiyigo.struts.serviceImpl;

import java.util.List;

import com.caiyigo.struts.dao.IEmployeeDao;
import com.caiyigo.struts.daoImpl.EmployeeDaoImpl;
import com.caiyigo.struts.model.Employee;
import com.caiyigo.struts.service.IEmployeeService;

public class EmployeeServiceImpl implements IEmployeeService {
	private IEmployeeDao dao;

	public EmployeeServiceImpl() {
		this.dao = new EmployeeDaoImpl();
	}

	public List<Employee> getAllEmployees() {
		return dao.getAllEmployees();
	}

	public void updateEmployee(Employee emp) {
		dao.update(emp);
	}

	public void deleteEmployee(Integer id) {
		dao.deleteById(id);
	}

	public Employee getEmployee(Integer id) {
		return dao.getEmployeeById(id);
	}

	public void insertEmployee(Employee emp) {
		dao.insert(emp);
	}
}